package day020;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.List;

public class ObjectInputStreamDemo2 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ObjectInputStream ois = new ObjectInputStream(new FileInputStream("D:\\day020\\userList.txt"));

        List<User> userList = (ArrayList<User>) ois.readObject();
        ois.close();

        for (User user : userList) {
            System.out.println(user);
        }
    }
}
